﻿namespace Sidvall.WorkItemManager.Net.Services.V1
{
    [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling")]
    public sealed partial class Schedule : global::Sidvall.Data.ServiceDataRowBase, global::Sidvall.WorkItemManager.Data.ISchedule
    {
        #region Public Members

        #region DayEndTime

        private System.Nullable<System.DateTime> _DayEndTime;
        partial void OnBeforeDayEndTimePropertyChanged(Sidvall.Business.PropertyChangeEventData<System.Nullable<System.DateTime>> eventData);
        partial void OnAfterDayEndTimePropertyChanged();
        public System.Nullable<System.DateTime> DayEndTime
        { 
            get
            {
                return _DayEndTime;
            }
            set
            {
                if (this.BusinessSettings.EnabledBusinessEvents == Sidvall.Business.BusinessEvents.None)
                {
                    _DayEndTime = value;
                }
                else
                {
                    Sidvall.Business.PropertyChangeEventData<System.Nullable<System.DateTime>> eventData = new Sidvall.Business.PropertyChangeEventData<System.Nullable<System.DateTime>>(value, _DayEndTime);
                    OnBeforeDayEndTimePropertyChanged(eventData);
                    if (!eventData.Cancel)
                    {
                        LoadInstanceField("DayEndTime", eventData.Value, true, true);
                        OnAfterDayEndTimePropertyChanged();
                    }
                }
            }
        }

        #endregion
        #region DayFrequency

        private byte _DayFrequency;
        partial void OnBeforeDayFrequencyPropertyChanged(Sidvall.Business.PropertyChangeEventData<byte> eventData);
        partial void OnAfterDayFrequencyPropertyChanged();
        public byte DayFrequency
        { 
            get
            {
                return _DayFrequency;
            }
            set
            {
                if (this.BusinessSettings.EnabledBusinessEvents == Sidvall.Business.BusinessEvents.None)
                {
                    _DayFrequency = value;
                }
                else
                {
                    Sidvall.Business.PropertyChangeEventData<byte> eventData = new Sidvall.Business.PropertyChangeEventData<byte>(value, _DayFrequency);
                    OnBeforeDayFrequencyPropertyChanged(eventData);
                    if (!eventData.Cancel)
                    {
                        LoadInstanceField("DayFrequency", eventData.Value, true, true);
                        OnAfterDayFrequencyPropertyChanged();
                    }
                }
            }
        }

        #endregion
        #region DayFrequencyTypeId

        private global::Sidvall.WorkItemManager.Workflow.Conditions.DayFrequencyType _DayFrequencyTypeId;
        partial void OnBeforeDayFrequencyTypeIdPropertyChanged(Sidvall.Business.PropertyChangeEventData<global::Sidvall.WorkItemManager.Workflow.Conditions.DayFrequencyType> eventData);
        partial void OnAfterDayFrequencyTypeIdPropertyChanged();
        public global::Sidvall.WorkItemManager.Workflow.Conditions.DayFrequencyType DayFrequencyTypeId
        { 
            get
            {
                return _DayFrequencyTypeId;
            }
            set
            {
                if (this.BusinessSettings.EnabledBusinessEvents == Sidvall.Business.BusinessEvents.None)
                {
                    _DayFrequencyTypeId = value;
                }
                else
                {
                    Sidvall.Business.PropertyChangeEventData<global::Sidvall.WorkItemManager.Workflow.Conditions.DayFrequencyType> eventData = new Sidvall.Business.PropertyChangeEventData<global::Sidvall.WorkItemManager.Workflow.Conditions.DayFrequencyType>(value, _DayFrequencyTypeId);
                    OnBeforeDayFrequencyTypeIdPropertyChanged(eventData);
                    if (!eventData.Cancel)
                    {
                        LoadInstanceField("DayFrequencyTypeId", eventData.Value, true, true);
                        OnAfterDayFrequencyTypeIdPropertyChanged();
                    }
                }
            }
        }

        #endregion
        #region DayStartTime

        private System.Nullable<System.DateTime> _DayStartTime;
        partial void OnBeforeDayStartTimePropertyChanged(Sidvall.Business.PropertyChangeEventData<System.Nullable<System.DateTime>> eventData);
        partial void OnAfterDayStartTimePropertyChanged();
        public System.Nullable<System.DateTime> DayStartTime
        { 
            get
            {
                return _DayStartTime;
            }
            set
            {
                if (this.BusinessSettings.EnabledBusinessEvents == Sidvall.Business.BusinessEvents.None)
                {
                    _DayStartTime = value;
                }
                else
                {
                    Sidvall.Business.PropertyChangeEventData<System.Nullable<System.DateTime>> eventData = new Sidvall.Business.PropertyChangeEventData<System.Nullable<System.DateTime>>(value, _DayStartTime);
                    OnBeforeDayStartTimePropertyChanged(eventData);
                    if (!eventData.Cancel)
                    {
                        LoadInstanceField("DayStartTime", eventData.Value, true, true);
                        OnAfterDayStartTimePropertyChanged();
                    }
                }
            }
        }

        #endregion
        #region EndDate

        private System.Nullable<System.DateTime> _EndDate;
        partial void OnBeforeEndDatePropertyChanged(Sidvall.Business.PropertyChangeEventData<System.Nullable<System.DateTime>> eventData);
        partial void OnAfterEndDatePropertyChanged();
        public System.Nullable<System.DateTime> EndDate
        { 
            get
            {
                return _EndDate;
            }
            set
            {
                if (this.BusinessSettings.EnabledBusinessEvents == Sidvall.Business.BusinessEvents.None)
                {
                    _EndDate = value;
                }
                else
                {
                    Sidvall.Business.PropertyChangeEventData<System.Nullable<System.DateTime>> eventData = new Sidvall.Business.PropertyChangeEventData<System.Nullable<System.DateTime>>(value, _EndDate);
                    OnBeforeEndDatePropertyChanged(eventData);
                    if (!eventData.Cancel)
                    {
                        LoadInstanceField("EndDate", eventData.Value, true, true);
                        OnAfterEndDatePropertyChanged();
                    }
                }
            }
        }

        #endregion
        #region Friday

        private bool _Friday;
        partial void OnBeforeFridayPropertyChanged(Sidvall.Business.PropertyChangeEventData<bool> eventData);
        partial void OnAfterFridayPropertyChanged();
        public bool Friday
        { 
            get
            {
                return _Friday;
            }
            set
            {
                if (this.BusinessSettings.EnabledBusinessEvents == Sidvall.Business.BusinessEvents.None)
                {
                    _Friday = value;
                }
                else
                {
                    Sidvall.Business.PropertyChangeEventData<bool> eventData = new Sidvall.Business.PropertyChangeEventData<bool>(value, _Friday);
                    OnBeforeFridayPropertyChanged(eventData);
                    if (!eventData.Cancel)
                    {
                        LoadInstanceField("Friday", eventData.Value, true, true);
                        OnAfterFridayPropertyChanged();
                    }
                }
            }
        }

        #endregion
        #region Monday

        private bool _Monday;
        partial void OnBeforeMondayPropertyChanged(Sidvall.Business.PropertyChangeEventData<bool> eventData);
        partial void OnAfterMondayPropertyChanged();
        public bool Monday
        { 
            get
            {
                return _Monday;
            }
            set
            {
                if (this.BusinessSettings.EnabledBusinessEvents == Sidvall.Business.BusinessEvents.None)
                {
                    _Monday = value;
                }
                else
                {
                    Sidvall.Business.PropertyChangeEventData<bool> eventData = new Sidvall.Business.PropertyChangeEventData<bool>(value, _Monday);
                    OnBeforeMondayPropertyChanged(eventData);
                    if (!eventData.Cancel)
                    {
                        LoadInstanceField("Monday", eventData.Value, true, true);
                        OnAfterMondayPropertyChanged();
                    }
                }
            }
        }

        #endregion
        #region MonthFrequency

        private byte _MonthFrequency;
        partial void OnBeforeMonthFrequencyPropertyChanged(Sidvall.Business.PropertyChangeEventData<byte> eventData);
        partial void OnAfterMonthFrequencyPropertyChanged();
        public byte MonthFrequency
        { 
            get
            {
                return _MonthFrequency;
            }
            set
            {
                if (this.BusinessSettings.EnabledBusinessEvents == Sidvall.Business.BusinessEvents.None)
                {
                    _MonthFrequency = value;
                }
                else
                {
                    Sidvall.Business.PropertyChangeEventData<byte> eventData = new Sidvall.Business.PropertyChangeEventData<byte>(value, _MonthFrequency);
                    OnBeforeMonthFrequencyPropertyChanged(eventData);
                    if (!eventData.Cancel)
                    {
                        LoadInstanceField("MonthFrequency", eventData.Value, true, true);
                        OnAfterMonthFrequencyPropertyChanged();
                    }
                }
            }
        }

        #endregion
        #region MonthFrequencyTypeId

        private global::Sidvall.WorkItemManager.Workflow.Conditions.MonthFrequencyType _MonthFrequencyTypeId;
        partial void OnBeforeMonthFrequencyTypeIdPropertyChanged(Sidvall.Business.PropertyChangeEventData<global::Sidvall.WorkItemManager.Workflow.Conditions.MonthFrequencyType> eventData);
        partial void OnAfterMonthFrequencyTypeIdPropertyChanged();
        public global::Sidvall.WorkItemManager.Workflow.Conditions.MonthFrequencyType MonthFrequencyTypeId
        { 
            get
            {
                return _MonthFrequencyTypeId;
            }
            set
            {
                if (this.BusinessSettings.EnabledBusinessEvents == Sidvall.Business.BusinessEvents.None)
                {
                    _MonthFrequencyTypeId = value;
                }
                else
                {
                    Sidvall.Business.PropertyChangeEventData<global::Sidvall.WorkItemManager.Workflow.Conditions.MonthFrequencyType> eventData = new Sidvall.Business.PropertyChangeEventData<global::Sidvall.WorkItemManager.Workflow.Conditions.MonthFrequencyType>(value, _MonthFrequencyTypeId);
                    OnBeforeMonthFrequencyTypeIdPropertyChanged(eventData);
                    if (!eventData.Cancel)
                    {
                        LoadInstanceField("MonthFrequencyTypeId", eventData.Value, true, true);
                        OnAfterMonthFrequencyTypeIdPropertyChanged();
                    }
                }
            }
        }

        #endregion
        #region Saturday

        private bool _Saturday;
        partial void OnBeforeSaturdayPropertyChanged(Sidvall.Business.PropertyChangeEventData<bool> eventData);
        partial void OnAfterSaturdayPropertyChanged();
        public bool Saturday
        { 
            get
            {
                return _Saturday;
            }
            set
            {
                if (this.BusinessSettings.EnabledBusinessEvents == Sidvall.Business.BusinessEvents.None)
                {
                    _Saturday = value;
                }
                else
                {
                    Sidvall.Business.PropertyChangeEventData<bool> eventData = new Sidvall.Business.PropertyChangeEventData<bool>(value, _Saturday);
                    OnBeforeSaturdayPropertyChanged(eventData);
                    if (!eventData.Cancel)
                    {
                        LoadInstanceField("Saturday", eventData.Value, true, true);
                        OnAfterSaturdayPropertyChanged();
                    }
                }
            }
        }

        #endregion
        #region ScheduleFrequency

        private byte _ScheduleFrequency;
        partial void OnBeforeScheduleFrequencyPropertyChanged(Sidvall.Business.PropertyChangeEventData<byte> eventData);
        partial void OnAfterScheduleFrequencyPropertyChanged();
        public byte ScheduleFrequency
        { 
            get
            {
                return _ScheduleFrequency;
            }
            set
            {
                if (this.BusinessSettings.EnabledBusinessEvents == Sidvall.Business.BusinessEvents.None)
                {
                    _ScheduleFrequency = value;
                }
                else
                {
                    Sidvall.Business.PropertyChangeEventData<byte> eventData = new Sidvall.Business.PropertyChangeEventData<byte>(value, _ScheduleFrequency);
                    OnBeforeScheduleFrequencyPropertyChanged(eventData);
                    if (!eventData.Cancel)
                    {
                        LoadInstanceField("ScheduleFrequency", eventData.Value, true, true);
                        OnAfterScheduleFrequencyPropertyChanged();
                    }
                }
            }
        }

        #endregion
        #region ScheduleFrequencyTypeId

        private global::Sidvall.WorkItemManager.Workflow.Conditions.ScheduleFrequencyType _ScheduleFrequencyTypeId;
        partial void OnBeforeScheduleFrequencyTypeIdPropertyChanged(Sidvall.Business.PropertyChangeEventData<global::Sidvall.WorkItemManager.Workflow.Conditions.ScheduleFrequencyType> eventData);
        partial void OnAfterScheduleFrequencyTypeIdPropertyChanged();
        public global::Sidvall.WorkItemManager.Workflow.Conditions.ScheduleFrequencyType ScheduleFrequencyTypeId
        { 
            get
            {
                return _ScheduleFrequencyTypeId;
            }
            set
            {
                if (this.BusinessSettings.EnabledBusinessEvents == Sidvall.Business.BusinessEvents.None)
                {
                    _ScheduleFrequencyTypeId = value;
                }
                else
                {
                    Sidvall.Business.PropertyChangeEventData<global::Sidvall.WorkItemManager.Workflow.Conditions.ScheduleFrequencyType> eventData = new Sidvall.Business.PropertyChangeEventData<global::Sidvall.WorkItemManager.Workflow.Conditions.ScheduleFrequencyType>(value, _ScheduleFrequencyTypeId);
                    OnBeforeScheduleFrequencyTypeIdPropertyChanged(eventData);
                    if (!eventData.Cancel)
                    {
                        LoadInstanceField("ScheduleFrequencyTypeId", eventData.Value, true, true);
                        OnAfterScheduleFrequencyTypeIdPropertyChanged();
                    }
                }
            }
        }

        #endregion
        #region ScheduleId

        private System.Nullable<long> _ScheduleId;
        partial void OnBeforeScheduleIdPropertyChanged(Sidvall.Business.PropertyChangeEventData<System.Nullable<long>> eventData);
        partial void OnAfterScheduleIdPropertyChanged();
        public System.Nullable<long> ScheduleId
        { 
            get
            {
                return _ScheduleId;
            }
            set
            {
                if (this.BusinessSettings.EnabledBusinessEvents == Sidvall.Business.BusinessEvents.None)
                {
                    _ScheduleId = value;
                }
                else
                {
                    Sidvall.Business.PropertyChangeEventData<System.Nullable<long>> eventData = new Sidvall.Business.PropertyChangeEventData<System.Nullable<long>>(value, _ScheduleId);
                    OnBeforeScheduleIdPropertyChanged(eventData);
                    if (!eventData.Cancel)
                    {
                        LoadInstanceField("ScheduleId", eventData.Value, true, true);
                        OnAfterScheduleIdPropertyChanged();
                    }
                }
            }
        }

        #endregion
        #region StartTime

        private System.DateTime _StartTime;
        partial void OnBeforeStartTimePropertyChanged(Sidvall.Business.PropertyChangeEventData<System.DateTime> eventData);
        partial void OnAfterStartTimePropertyChanged();
        public System.DateTime StartTime
        { 
            get
            {
                return _StartTime;
            }
            set
            {
                if (this.BusinessSettings.EnabledBusinessEvents == Sidvall.Business.BusinessEvents.None)
                {
                    _StartTime = value;
                }
                else
                {
                    Sidvall.Business.PropertyChangeEventData<System.DateTime> eventData = new Sidvall.Business.PropertyChangeEventData<System.DateTime>(value, _StartTime);
                    OnBeforeStartTimePropertyChanged(eventData);
                    if (!eventData.Cancel)
                    {
                        LoadInstanceField("StartTime", eventData.Value, true, true);
                        OnAfterStartTimePropertyChanged();
                    }
                }
            }
        }

        #endregion
        #region Sunday

        private bool _Sunday;
        partial void OnBeforeSundayPropertyChanged(Sidvall.Business.PropertyChangeEventData<bool> eventData);
        partial void OnAfterSundayPropertyChanged();
        public bool Sunday
        { 
            get
            {
                return _Sunday;
            }
            set
            {
                if (this.BusinessSettings.EnabledBusinessEvents == Sidvall.Business.BusinessEvents.None)
                {
                    _Sunday = value;
                }
                else
                {
                    Sidvall.Business.PropertyChangeEventData<bool> eventData = new Sidvall.Business.PropertyChangeEventData<bool>(value, _Sunday);
                    OnBeforeSundayPropertyChanged(eventData);
                    if (!eventData.Cancel)
                    {
                        LoadInstanceField("Sunday", eventData.Value, true, true);
                        OnAfterSundayPropertyChanged();
                    }
                }
            }
        }

        #endregion
        #region Thursday

        private bool _Thursday;
        partial void OnBeforeThursdayPropertyChanged(Sidvall.Business.PropertyChangeEventData<bool> eventData);
        partial void OnAfterThursdayPropertyChanged();
        public bool Thursday
        { 
            get
            {
                return _Thursday;
            }
            set
            {
                if (this.BusinessSettings.EnabledBusinessEvents == Sidvall.Business.BusinessEvents.None)
                {
                    _Thursday = value;
                }
                else
                {
                    Sidvall.Business.PropertyChangeEventData<bool> eventData = new Sidvall.Business.PropertyChangeEventData<bool>(value, _Thursday);
                    OnBeforeThursdayPropertyChanged(eventData);
                    if (!eventData.Cancel)
                    {
                        LoadInstanceField("Thursday", eventData.Value, true, true);
                        OnAfterThursdayPropertyChanged();
                    }
                }
            }
        }

        #endregion
        #region Tuesday

        private bool _Tuesday;
        partial void OnBeforeTuesdayPropertyChanged(Sidvall.Business.PropertyChangeEventData<bool> eventData);
        partial void OnAfterTuesdayPropertyChanged();
        public bool Tuesday
        { 
            get
            {
                return _Tuesday;
            }
            set
            {
                if (this.BusinessSettings.EnabledBusinessEvents == Sidvall.Business.BusinessEvents.None)
                {
                    _Tuesday = value;
                }
                else
                {
                    Sidvall.Business.PropertyChangeEventData<bool> eventData = new Sidvall.Business.PropertyChangeEventData<bool>(value, _Tuesday);
                    OnBeforeTuesdayPropertyChanged(eventData);
                    if (!eventData.Cancel)
                    {
                        LoadInstanceField("Tuesday", eventData.Value, true, true);
                        OnAfterTuesdayPropertyChanged();
                    }
                }
            }
        }

        #endregion
        #region Wednesday

        private bool _Wednesday;
        partial void OnBeforeWednesdayPropertyChanged(Sidvall.Business.PropertyChangeEventData<bool> eventData);
        partial void OnAfterWednesdayPropertyChanged();
        public bool Wednesday
        { 
            get
            {
                return _Wednesday;
            }
            set
            {
                if (this.BusinessSettings.EnabledBusinessEvents == Sidvall.Business.BusinessEvents.None)
                {
                    _Wednesday = value;
                }
                else
                {
                    Sidvall.Business.PropertyChangeEventData<bool> eventData = new Sidvall.Business.PropertyChangeEventData<bool>(value, _Wednesday);
                    OnBeforeWednesdayPropertyChanged(eventData);
                    if (!eventData.Cancel)
                    {
                        LoadInstanceField("Wednesday", eventData.Value, true, true);
                        OnAfterWednesdayPropertyChanged();
                    }
                }
            }
        }

        #endregion
        #region DataRowContextStorageKey

        protected override string DataRowContextStorageKey
        {
            get
            {
                return global::Sidvall.WorkItemManager.SystemContextConfig.Current.EntityFacade.ScheduleManager.GetKey(this);
            }
        }

        #endregion
        #region DataRowStateIsDirty

        protected override bool DataRowStateIsDirty
        {
            get
            {
                return global::Sidvall.WorkItemManager.SystemContextConfig.Current.EntityFacade.ScheduleManager.DataRowStateIsDirty(this);
            }
        }

        #endregion
        #region LoadInstanceField

        public void LoadInstanceField(string fieldName, object value, bool cascade, bool updateState)
        {
            global::Sidvall.WorkItemManager.SystemContextConfig.Current.EntityFacade.ScheduleManager.LoadInstanceField(this, fieldName, value, cascade, false, updateState);
        }

        #endregion
        #region Copy

        public Schedule Copy()
        {
            return global::Sidvall.WorkItemManager.SystemContextConfig.Current.EntityFacade.ScheduleManager.Copy(this);
        }
        public Schedule Copy(Sidvall.Data.CopySettings settings)
        {
            return global::Sidvall.WorkItemManager.SystemContextConfig.Current.EntityFacade.ScheduleManager.Copy(this, settings);
        }

        #endregion
        #region Import

        public void Import(global::Sidvall.WorkItemManager.Data.ISchedule item)
        {
            global::Sidvall.WorkItemManager.SystemContextConfig.Current.EntityFacade.ScheduleManager.Import(this, item);
        }
        public void Import(global::Sidvall.WorkItemManager.Data.ISchedule item, Sidvall.Data.CopySettings settings)
        {
            global::Sidvall.WorkItemManager.SystemContextConfig.Current.EntityFacade.ScheduleManager.Import(this, item, settings);
        }

        #endregion
        #region ValidateAsync

        public async System.Threading.Tasks.Task<Sidvall.Data.BusinessRuleCollection> ValidateAsync()
        {
            return await global::Sidvall.WorkItemManager.SystemContextConfig.Current.EntityFacade.ScheduleManager.ValidateAsync(this).ConfigureAwait(false);
        }
        public async System.Threading.Tasks.Task<Sidvall.Data.BusinessRuleCollection> ValidateAsync(Sidvall.Data.ValidationSettings settings)
        {
            return await global::Sidvall.WorkItemManager.SystemContextConfig.Current.EntityFacade.ScheduleManager.ValidateAsync(this, settings).ConfigureAwait(false);
        }

        #endregion
        #region Initialize

        public void Initialize()
        {
            global::Sidvall.WorkItemManager.SystemContextConfig.Current.EntityFacade.ScheduleManager.Initialize(this);
        }
        public void Initialize(Sidvall.Data.InitializeSettings settings)
        {
            global::Sidvall.WorkItemManager.SystemContextConfig.Current.EntityFacade.ScheduleManager.Initialize(this, settings);
        }

        #endregion

        #region ISchedule Members

        System.Nullable<System.DateTime> global::Sidvall.WorkItemManager.Data.ISchedule.DayEndTime
        {
            get
            {
                return this._DayEndTime;
            }
            set
            {
                this._DayEndTime = value;
            }
        }
        byte global::Sidvall.WorkItemManager.Data.ISchedule.DayFrequency
        {
            get
            {
                return this._DayFrequency;
            }
            set
            {
                this._DayFrequency = value;
            }
        }
        global::Sidvall.WorkItemManager.Workflow.Conditions.DayFrequencyType global::Sidvall.WorkItemManager.Data.ISchedule.DayFrequencyTypeId
        {
            get
            {
                return this._DayFrequencyTypeId;
            }
            set
            {
                this._DayFrequencyTypeId = value;
            }
        }
        System.Nullable<System.DateTime> global::Sidvall.WorkItemManager.Data.ISchedule.DayStartTime
        {
            get
            {
                return this._DayStartTime;
            }
            set
            {
                this._DayStartTime = value;
            }
        }
        System.Nullable<System.DateTime> global::Sidvall.WorkItemManager.Data.ISchedule.EndDate
        {
            get
            {
                return this._EndDate;
            }
            set
            {
                this._EndDate = value;
            }
        }
        bool global::Sidvall.WorkItemManager.Data.ISchedule.Friday
        {
            get
            {
                return this._Friday;
            }
            set
            {
                this._Friday = value;
            }
        }
        bool global::Sidvall.WorkItemManager.Data.ISchedule.Monday
        {
            get
            {
                return this._Monday;
            }
            set
            {
                this._Monday = value;
            }
        }
        byte global::Sidvall.WorkItemManager.Data.ISchedule.MonthFrequency
        {
            get
            {
                return this._MonthFrequency;
            }
            set
            {
                this._MonthFrequency = value;
            }
        }
        global::Sidvall.WorkItemManager.Workflow.Conditions.MonthFrequencyType global::Sidvall.WorkItemManager.Data.ISchedule.MonthFrequencyTypeId
        {
            get
            {
                return this._MonthFrequencyTypeId;
            }
            set
            {
                this._MonthFrequencyTypeId = value;
            }
        }
        bool global::Sidvall.WorkItemManager.Data.ISchedule.Saturday
        {
            get
            {
                return this._Saturday;
            }
            set
            {
                this._Saturday = value;
            }
        }
        byte global::Sidvall.WorkItemManager.Data.ISchedule.ScheduleFrequency
        {
            get
            {
                return this._ScheduleFrequency;
            }
            set
            {
                this._ScheduleFrequency = value;
            }
        }
        global::Sidvall.WorkItemManager.Workflow.Conditions.ScheduleFrequencyType global::Sidvall.WorkItemManager.Data.ISchedule.ScheduleFrequencyTypeId
        {
            get
            {
                return this._ScheduleFrequencyTypeId;
            }
            set
            {
                this._ScheduleFrequencyTypeId = value;
            }
        }
        System.Nullable<long> global::Sidvall.WorkItemManager.Data.ISchedule.ScheduleId
        {
            get
            {
                return this._ScheduleId;
            }
            set
            {
                this._ScheduleId = value;
            }
        }
        System.DateTime global::Sidvall.WorkItemManager.Data.ISchedule.StartTime
        {
            get
            {
                return this._StartTime;
            }
            set
            {
                this._StartTime = value;
            }
        }
        bool global::Sidvall.WorkItemManager.Data.ISchedule.Sunday
        {
            get
            {
                return this._Sunday;
            }
            set
            {
                this._Sunday = value;
            }
        }
        bool global::Sidvall.WorkItemManager.Data.ISchedule.Thursday
        {
            get
            {
                return this._Thursday;
            }
            set
            {
                this._Thursday = value;
            }
        }
        bool global::Sidvall.WorkItemManager.Data.ISchedule.Tuesday
        {
            get
            {
                return this._Tuesday;
            }
            set
            {
                this._Tuesday = value;
            }
        }
        bool global::Sidvall.WorkItemManager.Data.ISchedule.Wednesday
        {
            get
            {
                return this._Wednesday;
            }
            set
            {
                this._Wednesday = value;
            }
        }

        #endregion

        #endregion
        #region Constructors

        public Schedule()
        {
        }
        public Schedule(bool initializeDefaultValues)
            : this(initializeDefaultValues, null, Sidvall.Business.BusinessEvents.None)
        {
        }
        public Schedule(bool initializeDefaultValues, Sidvall.Data.DataRowState? dataRowState, Sidvall.Business.BusinessEvents enabledBusinessEvents)
            : base(dataRowState, enabledBusinessEvents)
        {
            if (initializeDefaultValues)
                global::Sidvall.WorkItemManager.SystemContextConfig.Current.EntityFacade.ScheduleManager.Initialize(this);
        }

        #endregion
    }
}